Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small optimization for nonjagged branches #93

Merged
merged 1 commit into from
Sep 10, 2021

Conversation

aminnj
Copy link
Member

@aminnj aminnj commented Sep 10, 2021

Forgot to show non-jagged code paths some love when we were optimizing jagged branches earlier. This gives a 5-10% improvement in non-jagged branch speed.

     if J == Nojagg
-        return map(ntoh, reinterpret(T, rawdata))
+        return ntoh.(reinterpret(T, rawdata))

@codecov
Copy link

codecov bot commented Sep 10, 2021

Codecov Report

Merging #93 (6548071) into master (fe11279) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #93   +/-   ##
=======================================
  Coverage   84.84%   84.84%           
=======================================
  Files          11       11           
  Lines        1320     1320           
=======================================
  Hits         1120     1120           
  Misses        200      200           
Impacted Files Coverage Δ
src/root.jl 90.90% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fe11279...6548071. Read the comment docs.

@aminnj aminnj merged commit 00d661a into JuliaHEP:master Sep 10, 2021
@aminnj aminnj deleted the nonjagged-optim branch September 10, 2021 08:02
@Moelf
Copy link
Member

Moelf commented Sep 10, 2021

we may need to special case Bool

julia> a = [UInt8(1) for _ = 1:3];

julia> map(ntoh, reinterpret(Bool, a))
3-element Vector{Bool}:
 1
 1
 1

julia> ntoh.(reinterpret(Bool, a))
3-element BitVector:
 1
 1
 1

@aminnj
Copy link
Member Author

aminnj commented Sep 10, 2021

I thought the second one is better because BitVector is 8x smaller in memory? Or is it noticeably slower?

@Moelf
Copy link
Member

Moelf commented Sep 10, 2021

I think it throws off our type detection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants